#pragma once
#include <QtGui/QListWidget>
#include <QtGui/QMouseEvent>
#include "ComDialog.h"
class CMaterialWidget;
class CListWidgetItem :
	public QListWidgetItem
{
public:
	CListWidgetItem(const QIcon &icon, const QString &text, std::string file);
	virtual ~CListWidgetItem();
	void popup();
	inline void setImage(QImage* img){ m_pImage = img;}
	inline QImage* getImage(){ return m_pImage;}
private:
	CMaterialWidget* m_pMaterials;
	QImage* m_pImage;
};
class CMaterialGroup :
	public QListWidget
{
	Q_OBJECT;
public:
	CMaterialGroup(QWidget* p = NULL);
	virtual ~CMaterialGroup(void);
public slots:
	void addMaterial();
	void removeMaterial();

	void editingMaterial();
	void materialAttribute();
protected:
	void mousePressEvent( QMouseEvent * );
	void mouseDoubleClickEvent( QMouseEvent* eve );
private:
	QString m_path;
};

